export function MyAlert() {
    this.obj = null;
}

MyAlert.init = function () {
    if (this.obj) {
        return this.obj
    } else {
        return this.obj = new MyAlert()
    }
}
MyAlert.prototype.loading = () => {
    window.MINT.Indicator.open('加载中...');
}
MyAlert.prototype.close = () => {
    window.MINT.Indicator.close();
}
MyAlert.prototype.clear = () => {
    window.MINT.Indicator.close();
}

MyAlert.prototype.fail = (msg) => {
    window.MINT.Toast({
        message: msg,
        iconClass: 'iconfont icon-close'
    });
}
MyAlert.prototype.success = (msg) => {
    window.MINT.Toast({
        message: msg,
        iconClass: 'iconfont icon-duigou',
    });
}
MyAlert.prototype.confirm = (url) => {
    var url = url || "确定执行此操作?"
    return window.MINT.MessageBox.confirm(url)
}
export default MyAlert.init()